function ShrinkButton() {


    /**
    * Shrink button base css class name prefix.
    *
    * @private
    * @property cssPrefix
    * @type     String
    * @default  messWindowShrinkButton
    */
    this.cssPrefix = "ShrinkButton";

    /**
    * Button default action
    *
    * @private
    * @property  action
    * @type      String
    * @default   shrinkWindow
    */
    this.action = "shrinkWindow";

    
    this.CSS_BOTTOM_SUFFIX = "Bottom";
    this.CSS_TOP_SUFFIX = "Top";
    this.CSS_RIGHT_SUFFIX = "Right";
    this.CSS_LEFT_SUFFIX = "Left";
}
ShrinkButton.prototype = new ActionButton();
ShrinkButton.prototype.toString = function() { return "js.mess.ui.controls.windows.buttons.ShrinkButton"; };
MessUIElement.prototype.addTagMapping("shrinkButton", "ShrinkButton");



	/**
	 * Sets button representation
	 * 
	 * @public
	 * @method  setButtonRepresentation
	 */
	ShrinkButton.prototype.setButtonRepresentation = function() {
		
        if (this.parent.isHorizontal()) {
            this.setHorizontalRepresentation();
        }
        else if (this.parent.isVertical()) {
            this.setVerticalRepresentation();
        }
	};

    /**
    * Sets 'horizontal specific' button representation
    *
    * @private
    * @method   setHorizontalRepresentation
    */
    ShrinkButton.prototype.setHorizontalRepresentation = function() {

        var prevSibling = this.parent.getPrevSibling();
        var nextSibling = this.parent.getNextSibling();

        if (prevSibling === null) {
        // top edge panel

                if (nextSibling === null) {
                // top-bottom edge panel (assume bottom)
                    if (this.parent.isShrinked()) {
                        this.setButtonType(this.CSS_TOP_SUFFIX);
                    }
                    else {
                        this.setButtonType(this.CSS_BOTTOM_SUFFIX);
                    }
                }
                else {
                    if (this.parent.isShrinked()) {
                        this.setButtonType(this.CSS_BOTTOM_SUFFIX);
                    }
                    else {
                        this.setButtonType(this.CSS_TOP_SUFFIX);
                    }
                }
        }
        else {
                if (nextSibling === null) {
                // bottom edge panel
                    if (this.parent.isShrinked()) {
                        this.setButtonType(this.CSS_TOP_SUFFIX);
                    }
                    else {
                        this.setButtonType(this.CSS_BOTTOM_SUFFIX);
                    }
                }
                else {
                // middle panel

                    if (this.parent.isShrinked()) {
                    // shrinked
                        this.setButtonType(this.CSS_BOTTOM_SUFFIX);

                        var hasExpandedSibling = this.parent.hasExpandedSibling(nextSibling, "getNextSibling");
                        if (!hasExpandedSibling) {
                            this.setButtonType(this.CSS_TOP_SUFFIX);
                        }
                    }
                    else {
                    // not-shrinked
                        this.setButtonType(this.CSS_TOP_SUFFIX);

                        try {
                            var hasExpandedSibling = this.parent.hasExpandedSibling(nextSibling, "getNextSibling");

                            if (!hasExpandedSibling) {
                                this.setButtonType(this.CSS_BOTTOM_SUFFIX);
                            }
                        }catch(ex) {}
                    }
                }
        }
    };

    /**
    * Sets 'vertical specific' button representation
    *
    * @private
    * @method   setVerticalRepresentation
    */
    ShrinkButton.prototype.setVerticalRepresentation = function() {
		
		var prevSibling = this.parent.getPrevSibling();
        var nextSibling = this.parent.getNextSibling();

        if (prevSibling === null) {
        // left edge panel

                if (this.parent.isShrinked()) {
                    this.setButtonType(this.CSS_RIGHT_SUFFIX);
                }
                else {
                    this.setButtonType(this.CSS_LEFT_SUFFIX);
                }
        }
        else {
                if (nextSibling === null) {
                // right edge panel
                    if (this.parent.isShrinked()) {
                        this.setButtonType(this.CSS_LEFT_SUFFIX);
                    }
                    else {
                        this.setButtonType(this.CSS_RIGHT_SUFFIX);
                    }
                }
                else {
                // middle panel

                    if (this.parent.isShrinked()) {
                    // shrinked
                        this.setButtonType(this.CSS_RIGHT_SUFFIX);

                        var hasExpandedSibling = this.parent.hasExpandedSibling(nextSibling, "getNextSibling");
                        if (!hasExpandedSibling) {
                            this.setButtonType(this.CSS_LEFT_SUFFIX);
                        }


                    }
                    else {
                    // not-shrinked
                        this.setButtonType(this.CSS_RIGHT_SUFFIX);

                        try {
                            var hasExpandedSibling = this.parent.hasExpandedSibling(nextSibling, "getNextSibling");

                            if (!hasExpandedSibling) {
                                this.setButtonType(this.CSS_LEFT_SUFFIX);
                            }
                        }catch(ex) {}
                    }
                }
        }
    };




    
